<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       let money=1500
        while (true) {
            let input =+prompt(`请选择操作:
            1、存钱
            2、取钱
            3、查看余额
            4、退出功能`)
                if (input===4) {
                    alert('退出功能')
                break;
                    }
            switch (input) {
                case 1:
                    let make=+prompt('请输入存钱金额:')
                    money += make
                    alert(`存钱成功`)
                    break;
                case 2:
                    let take=+prompt('请输入取钱金额:')
                    if (take<=money) {
                        money -= take
                      alert(`取钱成功`)
                    }else{
                        alert('余额不足')
                    }
                    break;
                case 3:
                    alert(`当前余额为${money}`)
                    break;
                default:alert('无效，重新操作')
                    break;
            }
            }
    </script>
</body>
</html>